import request from '@/utils/request'

export function getAllRestaurants(query) {
  return request({
    url: '/community/ec/restaurants',
    // url: '/e-commerce/restaurants/list',
    method: 'get',
    params: query
  })
}

export function addRestaurant(restaurant) {
  return request({
    url: '/community/ec/restaurant',
    method: 'post',
    data: restaurant
  })
}

export function updateRestaurant(restaurant) {
  return request({
    url: '/community/ec/restaurant',
    method: 'put',
    data: restaurant
  })
}

export function updateRestaurantState(restaurant) {
  return request({
    url: '/community/ec/restaurantState',
    method: 'put',
    data: restaurant
  })
}

export function removeRestaurant(restaurantId) {
  return request({
    url: '/community/ec/restaurant/' + restaurantId,
    method: 'delete'
  })
}

export function getAllNavigates() {
  return request({
    url: '/community/ec/navigates',
    method: 'get'
  })
}
